package com.jcfriends.main.payment.service;

import java.util.ArrayList;

import org.apache.commons.lang.NumberUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jcfriends.common.util.DateUtils;
import com.jcfriends.main.payment.dao.PaymentDao;
import com.jcfriends.main.payment.pojo.PaymentInfo;

@Service
public class PaymentServiceImpl implements PaymentService {

	
	@Autowired
	private PaymentDao paymentDao;
	
	public ArrayList<PaymentInfo> getPaymentList(PaymentInfo paymentInfo){
		
		return (ArrayList)paymentDao.getPaymentList(paymentInfo);
	}
	
	public PaymentInfo getPayment(PaymentInfo paymentInfo){
		return paymentDao.getPayment(paymentInfo);
	}
	
	public int putPayment(PaymentInfo paymentInfo){
		return paymentDao.putPayment(paymentInfo);
	}
	
	public int postPayment(PaymentInfo paymentInfo){
		
		//중복입력을 위해 삭제
		paymentDao.deletePayment(paymentInfo);
		
		return paymentDao.postPayment(paymentInfo);
	}
	
}
